package com.ay.shardingshere.mapper;

import com.ay.shardingshere.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: ay
 * @Date: 2021/6/24
 * @Description:
 **/
@Mapper
@Component
public interface UserMapper {

    /**
     * 保存用户信息
     * @param user
     */
    @Insert("insert into t_user(user_id,username,sex,age) value(#{username},#{sex},#{age})")
    void save(User user);


    /**
     * 查询用户列表
     * @return
     */
    @Select("select * from t_user")
    List<User> list();
}
